Many parts of GTK+ assume that all windows have a cairo surface
assoicated with them. This change provides a logically 1x1 cairo surface
(respecting scale) for the root window.
https://bugzilla.gnome.org/show_bug.cgi?id=704554
screen_wayland->visual = gdk_wayland_visual_new (screen);
+ init_multihead (screen);
+
screen_wayland->root_window =
_gdk_wayland_screen_create_root_window (screen,
- screen_wayland->width,
- screen_wayland->height);
+ screen_wayland->width,
+ screen_wayland->height);
- init_multihead (screen);
init_settings (screen);
return screen;
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
impl->wrapper = GDK_WINDOW (window);
+ if (gdk_screen_get_n_monitors(screen) > 0)
+ impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
+ else
+ impl->scale = 1;
+
+ /* logical 1x1 fake buffer */
+ impl->cairo_surface =
+ cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+ impl->scale,
+ impl->scale);
+
+#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE
+ cairo_surface_set_device_scale (impl->cairo_surface, impl->scale, impl->scale);
+#endif
window->window_type = GDK_WINDOW_ROOT;
window->depth = 32;